package com.wicket.okrapp.integration.dto;

import com.wicket.okrapp.common.dto.BaseDto;
import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;
import java.util.Objects;
import javax.validation.constraints.NotNull;
import lombok.Data;

/**
 * @desc EvaObjTargetCycleBudgetSetDto
 * @使用场景
 */
@Data
public class EvaObjTargetCycleBudgetSetDto
  extends BaseDto
  implements Serializable {

  /**
   * 被评对象目标周期ID
   */
  @NotNull(message = "被评对象目标周期ID不能为空")
  @ApiModelProperty("被评对象目标周期ID")
  private String evaObjTargetCycleId;

  /**
   * 预算金额
   */
  @NotNull(message = "预算金额不能为空")
  @ApiModelProperty("预算金额")
  private Double budget;

  /**
   * 资金来源ID
   */
  @NotNull(message = "资金来源ID不能为空")
  @ApiModelProperty("资金来源ID")
  private String capitalSourceId;

  @Override
  public boolean equals(Object o) {
    if (this == o) return true;
    if (o == null || getClass() != o.getClass()) return false;
    if (!super.equals(o)) return false;
    EvaObjTargetCycleBudgetSetDto that = (EvaObjTargetCycleBudgetSetDto) o;
    return (
      evaObjTargetCycleId == that.evaObjTargetCycleId &&
      budget == that.budget &&
      capitalSourceId == that.capitalSourceId
    );
  }

  @Override
  public int hashCode() {
    return Objects.hash(
      super.hashCode(),
      evaObjTargetCycleId,
      budget,
      capitalSourceId
    );
  }

}
